package com.example.CarManagement.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.example.CarManagement.enumPojo.ApprovalsDecision;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 审批记录表，记录用车申请的审批过程和结果
 * </p>
 *
 * @author 徐佳彪
 * @since 2025-07-17
 */
@TableName("c_approvals")
public class Approvals implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 审批记录ID
     */
    private String id;

    /**
     * 关联的申请ID，关联applications表
     */
    private String applicationId;

    /**
     * 审批人ID，关联users表
     */
    private String approverId;

    /**
     * 审批步骤序号
     */
    private Integer approvalStep;

    /**
     * 审批决定：approved-通过，rejected-拒绝，
     */
    private ApprovalsDecision decision;

    /**
     * 审批意见
     */
    private String comments;

    /**
     * 审批时间
     */
    private LocalDateTime decisionTime;

    /**
     * 记录创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 记录最后更新时间
     */
    private LocalDateTime updatedAt;

    private Byte deleted;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public String getApproverId() {
        return approverId;
    }

    public void setApproverId(String approverId) {
        this.approverId = approverId;
    }

    public Integer getApprovalStep() {
        return approvalStep;
    }

    public void setApprovalStep(Integer approvalStep) {
        this.approvalStep = approvalStep;
    }

    public ApprovalsDecision getDecision() {
        return decision;
    }

    public void setDecision(ApprovalsDecision decision) {
        this.decision = decision;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public LocalDateTime getDecisionTime() {
        return decisionTime;
    }

    public void setDecisionTime(LocalDateTime decisionTime) {
        this.decisionTime = decisionTime;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Byte getDeleted() {
        return deleted;
    }

    public void setDeleted(Byte deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "Approvals{" +
            "id = " + id +
            ", applicationId = " + applicationId +
            ", approverId = " + approverId +
            ", approvalStep = " + approvalStep +
            ", decision = " + decision +
            ", comments = " + comments +
            ", decisionTime = " + decisionTime +
            ", createdAt = " + createdAt +
            ", updatedAt = " + updatedAt +
            ", deleted = " + deleted +
        "}";
    }
}
